<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>时间线记录内存变化</title>
  </head>
  <body>
    <button id="btn">Add</button>
    <script>
      const arrList = [];
      function test() {
        for (let index = 0; index < 100000; index++) {
          const p = document.createElement("p");
          p.innerText = "123";
          document.body.appendChild(p);
        }
        arrList.push(new Array(1000000).join("x"));
      }
      oBtn = document.getElementById("btn");
      oBtn.addEventListener("click", test);
    </script>
  </body>
</html>
